<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>    
<%@ page import="com.zfh.entity.*" %>    

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>显示所有用户信息-用脚本方式</title>
<style type="text/css">
table tr:hover { background-color: #ccc;}
table tr td:hover { background-color: #999;}
</style>
</head>
<body>

<div align="center" >
	<a href="add.jsp">添加用户</a>
</div>

<table border="1" align="center">
<tr bgcolor="#bbb">
	<th>编号</th>
	<th>姓名</th>
	<th>性别</th>
	<th>生日</th>
	<th>分数</th>
	<th colspan="2">操作</th>
</tr>
<%
	List<User> users = (ArrayList<User>)request.getAttribute("users");
	for(User user : users){
		out.print("<tr>");
		out.print("<td>"+user.getId()+"</td>"+"<td>"+user.getName()+"</td>"+"<td>"+user.getGender()+"</td>"+"<td>"+user.getBir()+"</td>"+"<td>"+user.getScore()+"</td>");
		out.print("<td><a href='preEditUser?id="+user.getId()+"'>编辑</a></td>");
		out.print("<td><a href='delUser?id="+user.getId()+"'>删除</a></td>");
		out.print("</tr>");
	}
%>
</table>
</body>
</html>